package com.kelvin.oocl;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Server {
	private static Map<String, UserThread> currentUsers = new ConcurrentHashMap<String, UserThread>();
	
	public static void main(String[] args) {
		ServerSocket server = null;
		try {
			server = new ServerSocket(7888);
			System.out.println("server start...");
			while(true){
				Socket socket = server.accept();
				new UserThread(socket, currentUsers).start();
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
